//
//  CategoryDataTool.m
//  JiaoX
//
//  Created by jiaoxiu－004 on 14/11/17.
//  Copyright (c) 2014年 北京娇羞科技有限公司. All rights reserved.
//

#import "CategoryDataTool.h"

@implementation CategoryDataTool
+ (void)categoryDataInfoWithParam:(NSDictionary *)param success:(void (^)(CategoryInfo *result))success failure:(void (^)(NSError *error))failure{
    [self postWithUrl:[NSString stringWithFormat:@"%@product/category",BASE_URL] param:param hasT:NO resultClass:[CategoryInfo class] success:success failure:failure];
}

+ (void)prodListWithParam:(NSDictionary *)param success:(void (^)(ProductSearch *result))success failure:(void (^)(NSError *error))failure{
    [self postWithUrl:[NSString stringWithFormat:@"%@product/productList",BASE_URL] param:param hasT:NO resultClass:[ProductSearch class] success:success failure:failure];
}

+ (void)searchThinkKeysWithParam:(NSDictionary *)param success:(void (^)(SearchThinkKeys *result))success failure:(void (^)(NSError *error))failure{
    [self postWithUrl:[NSString stringWithFormat:@"%@product/think",BASE_URL] param:param hasT:NO resultClass:[SearchThinkKeys class] success:success failure:failure];
}

+ (void)searchProductDataWithKeyWords:(NSString *)keyWords success:(void (^)(ProductSearch *result))success failure:(void (^)(NSError *error))failure{
    JXBaseRequest *request = [[JXBaseRequest alloc]init];
    NSMutableDictionary *param = [NSMutableDictionary dictionaryWithDictionary:[request keyValues]];
    [param setObject:keyWords forKey:@"keywords"];
    [self postWithUrl:[NSString stringWithFormat:@"%@product/search",BASE_URL] param:param hasT:NO resultClass:[ProductSearch class] success:success failure:failure];
}

@end
